<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\vipcard;

class VipCardTradeJournalReqModel {
	
	static $_TSPEC;
	public $userId = null;
	public $cardNumber = null;
	public $startPageNumber = null;
	public $perPageCount = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'userId'
			),
			2 => array(
			'var' => 'cardNumber'
			),
			3 => array(
			'var' => 'startPageNumber'
			),
			4 => array(
			'var' => 'perPageCount'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['userId'])){
				
				$this->userId = $vals['userId'];
			}
			
			
			if (isset($vals['cardNumber'])){
				
				$this->cardNumber = $vals['cardNumber'];
			}
			
			
			if (isset($vals['startPageNumber'])){
				
				$this->startPageNumber = $vals['startPageNumber'];
			}
			
			
			if (isset($vals['perPageCount'])){
				
				$this->perPageCount = $vals['perPageCount'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'VipCardTradeJournalReqModel';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("userId" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->userId); 
				
			}
			
			
			
			
			if ("cardNumber" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->cardNumber);
				
			}
			
			
			
			
			if ("startPageNumber" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->startPageNumber); 
				
			}
			
			
			
			
			if ("perPageCount" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->perPageCount); 
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		$xfer += $output->writeFieldBegin('userId');
		$xfer += $output->writeI64($this->userId);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('cardNumber');
		$xfer += $output->writeString($this->cardNumber);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('startPageNumber');
		$xfer += $output->writeI32($this->startPageNumber);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('perPageCount');
		$xfer += $output->writeI32($this->perPageCount);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>